package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.SpecialistCompanyService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.SpecialistCompanyDelDto;
import com.ccys.db.dto.masterData.SpecialistCompanyPageQueryDto;
import com.ccys.db.dto.masterData.SpecialistCompanySaveDto;
import com.ccys.db.entity.TblSpecialistCompany;
import com.ccys.db.vo.masterData.SpecialistCompanyListVo;
import com.ccys.db.vo.masterData.SpecialistCompanyPageQueryVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @program: WhiteCoat
 * @description: 面板管理接口
 * @author: ZhangJingCan
 * @create: 2023-12-12 14:04
 **/
@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-面板管理接口")
public class SpecialistCompanyController {

    @Autowired
    private SpecialistCompanyService specialistCompanyService;


    @PostMapping("specialistCompany")
    @ApiOperation("保存面板管理")
    public ResponseResult save(SpecialistCompanySaveDto dto) {
        return specialistCompanyService.save(dto);
    }


    @PutMapping("specialistCompany")
    @ApiOperation("修改面板管理")
    public ResponseResult edit(SpecialistCompanySaveDto dto) {
        return specialistCompanyService.save(dto);
    }



    @DeleteMapping("specialistCompany")
    @ApiOperation("根据ID删除面板管理")
    public ResponseResult delete(SpecialistCompanyDelDto dto) {
        return specialistCompanyService.delete(dto);
    }


    @GetMapping("specialistCompany/page")
    @ApiOperation("分页查询面板管理")
    public ResponseResult<PageInfo<SpecialistCompanyPageQueryVo>, Object> findPage(SpecialistCompanyPageQueryDto dto) {
        return specialistCompanyService.findPage(dto);
    }

    @GetMapping("specialistCompany")
    @ApiOperation("查询面板管理集合")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "groupId", value = "groupId/查询所有传null", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "panelType", value = "1 specialist panel,2 GP panel", required = false, dataType = "string", paramType = "query"),
    })
    public ResponseResult<List<SpecialistCompanyListVo>, Object> findList(@ApiIgnore TblSpecialistCompany dto) {
        return specialistCompanyService.findList(dto);
    }
}
